/*
 * OpenParts
 * A dynamic-loading components framework for GWT
 * Copyright (C) 2011 Christophe Bouthier  [chris{AT}binary-gastronome{DOT}fr]
 *
 * This work is partially based on work I have done at INRIA (http://www.inria.fr) 
 * in the context of the Qualipso European Project (http://qualipso.org/),
 * The work done at INRIA is Copyright (C) 2006-2011 INRIA
 *
 * This work is distributed under the LGPL version 3
 *
 * This is free software; you can redistribute it and/or modify it
 * under the terms of the GNU Lesser General Public License version 3
 * as published by the Free Software Foundation. See the GNU
 * Lesser General Public License in LGPL.txt for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this software; if not, write to the Free
 * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
 * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
 */
package fr.openparts.OpenParts.client;

/**
 * OPEmbeddedViewMessageHandler is the interface to implement in order to handle messages send by an embedded view to its container view. Such handlers should
 * register themselves on the view proxy {@link OPViewProxy} view through its {@link OPViewProxy#addMessageHandler(OPMessageFromEmbeddedViewHandler)} method.
 * 
 * @author Christophe Bouthier [chris{AT}binary-gastronome{DOT}fr]
 * @creation.date 11 July 2010
 */
public interface OPMessageFromEmbeddedViewHandler {

    /**
     * Called when receiving a message from its embedded view.
     * 
     * @param message
     *            the message itself. Cannot be null.
     * @param params
     *            the parameters to the message. Can be null, can be empty.
     */
    void handleMessageFromEmbeddedView(final String message, final OPParams params);
    
    /**
     * Called when the embedded view is attached to the container view.
     */
    void onEmbeddedViewAttach();
    
}
